import 'package:flutter/material.dart';

class NavigatorDemo1 extends StatefulWidget {
  String content;

  NavigatorDemo1({Key key, this.content}) : super(key: key);

  @override
  _NavigatorDemo1State createState() => _NavigatorDemo1State();
}

class _NavigatorDemo1State extends State<NavigatorDemo1> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("路由"),
        centerTitle: true,
      ),
      body: Align(
        child: Column(
          children: <Widget>[
            Text("传递的值是:${widget.content}"),
            OutlineButton(
              child: Text('返回上一个页面'),
              onPressed: () {
                Navigator.pop(context, "{id:10,title:String.Class}");
              },
            )
          ],
        ),
      ),
    );
  }
}
